package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.common.result.Result;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @FileName: DepartmentController
 * @Author Steven
 * @Date: 2021/3/23
 */
@Api(tags = "医院部门信息")
@RequestMapping("admin/hosp/department")
@RestController
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @ApiOperation("根据医院编号查询所有科室")
    @GetMapping("/getDeptList/{hosCode}")
    public Result getDeptList(@PathVariable String hosCode){
        List<DepartmentVo> deptTree = departmentService.findDeptTree(hosCode);
        return Result.ok(deptTree);
    }

}
